package com.ly.honor.entity.dto;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author 李某人
 * @Date 2023/3/18 1:19
 * @Version 1.0
 */
@Data
public class MatchEditDTO {
    @NotNull(message = "比赛id不能为空")
    private Integer id;

    @NotNull(message = "甲队不能为空")
    private Integer clueIda;
    @NotNull(message = "乙队不能为空")
    private Integer clueIdb;

    @NotNull(message = "比分不能为空")
    private String score;

    @NotNull(message = "比赛时间不能为空")
    private Date matchTime;
    @NotNull(message = "预约数不能为空")
    private Integer subscribeNum;

    public void setMatchTime(String matchTime) {
        DateTime dt = DateUtil.parse(matchTime);
        this.matchTime = dt;
    }
}
